//
//  SignViewController.m
//  跨界收
//
//  Created by Allen on 2018/11/11.
//  Copyright © 2018年 gztx. All rights reserved.
//

#import "SignViewController.h"
#import "SignTableViewCell.h"
#import "ShangHuLeiXingViewController.h"

@interface SignViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableview;

@end

@implementation SignViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"签约管理";
    self.tableview.delegate = self;
    self.tableview.dataSource = self;
    self.tableview.separatorStyle =UITableViewCellSeparatorStyleNone;
    [self.tableview registerNib:[UINib nibWithNibName:@"SignTableViewCell" bundle:nil] forCellReuseIdentifier:@"cell"];
    self.tableview.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    // Do any additional setup after loading the view from its nib.
}
#pragma mark -- UITableViewDelegate/DataSource --
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    if (section == 0) {
        UILabel *dateLabel = [[UILabel alloc] initWithFrame:CGRectMake(15.0, 5, 280, 20)];
        dateLabel.font = [UIFont systemFontOfSize:14.0];
        dateLabel.textAlignment = NSTextAlignmentLeft;
        dateLabel.textColor = [UIColor lightGrayColor];
        dateLabel.text = @"请选择签约银行";
        
        UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-30.0, 30)];
        headerView.backgroundColor = [UIColor cz_colorWithHex:0xF1F1F1];
        [headerView addSubview:dateLabel];
        return headerView;
    }else
        return nil;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    if (section == 0) {
        return 30.0;
    }else
        return 10;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 120;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *identifier = @"cell";
    SignTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell) {
        cell = [[SignTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
    }
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    ShangHuLeiXingViewController *vc = [[ShangHuLeiXingViewController alloc] initWithNibName:@"ShangHuLeiXingViewController" bundle:nil];
    [self.navigationController pushViewController:vc animated:YES];
}
@end
